"use strict";

/**
 * @param {Egg.Application} app egg - application
 */
module.exports = app => {
    const DataTypes = app.Sequelize;

    const Model = app.model.define("audio_resource", {
        rid: {
            type: DataTypes.INTEGER(11),
            allowNull: false,
            primaryKey: true,
        },
        cover: {
            type: DataTypes.STRING(255),
            allowNull: true,
        },
        name: {
            type: DataTypes.STRING(255),
            allowNull: false,
        },
        object: {
            type: DataTypes.STRING(255),
            allowNull: false,
        },
        duration: {
            type: DataTypes.INTEGER(11),
            allowNull: false,
        },
        size: {
            type: DataTypes.INTEGER(11),
            allowNull: false,
        },
        lyric: {
            type: DataTypes.TEXT,
            allowNull: true,
        },
        artist: {
            type: DataTypes.STRING(255),
            allowNull: true,
        },
        mark: {
            type: DataTypes.TEXT,
            allowNull: true,
        },
        created_at: {
            type: DataTypes.DATE,
            allowNull: true,
        },
        updated_at: {
            type: DataTypes.DATE,
            allowNull: true,
        },
        deleted_at: {
            type: DataTypes.DATE,
            allowNull: true,
        },
    }, {
        tableName: "audio_resource",
    });

    Model.associate = function() {

    };

    return Model;
};
